﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shop.Master" AutoEventWireup="true" CodeBehind="Cesta.aspx.cs" Inherits="ShopNet.Cesta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">

<div id="content_top"></div>
<div id="content_middle">
    <h3>Carrinho de compras</h3>
    <div class="grid-12-12 table">
        <asp:GridView ID="gvCesta" runat="server" AutoGenerateColumns="False" 
            ShowFooter="true" CssClass="tbl" 
            onrowdatabound="gvCesta_RowDataBound" onrowcommand="gvCesta_RowCommand" >
            <HeaderStyle CssClass="table-head" />
            <FooterStyle CssClass="total" />
        <Columns>        
            <asp:TemplateField HeaderText="Produto">
                <ItemTemplate>
                    <asp:HyperLink ID="hlProduto" runat="server" ></asp:HyperLink>
                </ItemTemplate>            
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Quantidade" ItemStyle-Width="10%">
                <ItemTemplate>
                    <asp:TextBox ID="tbQtde" runat="server" CssClass="input_field_simple" Text='<%#Bind("QtdeProduto") %>'  MaxLength="3" Width="50"></asp:TextBox>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Qtde por unid.">
                <ItemTemplate>
                    <asp:Literal ID="lQtdeCadaPacote" runat="server" Text='<%#Bind("QtdeCadaPacote") %>'></asp:Literal>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Preço Unitário">
                <ItemTemplate>
                    <asp:Label ID="lPrecoUnitario" runat="server"></asp:Label>
                </ItemTemplate>
                <FooterTemplate>Total:</FooterTemplate>            
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Total">
                <ItemTemplate>
                    <asp:Label ID="lTotalCarrinho" runat="server" ></asp:Label>
                </ItemTemplate>
                <FooterTemplate>
                    R$ <%=Master.GetValorTotalProdCesta() %>
                </FooterTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <asp:ImageButton ID="ibDelete" CommandName="apagar" runat="server" ImageUrl="~/Imagem/remove.png" CommandArgument='<%#Bind("IdProduto") %>' />
                </ItemTemplate>
            
            </asp:TemplateField>
        
        </Columns>    
        </asp:GridView>
    </div>

    <p>&nbsp;</p>

    <div class="grid-5-12 ">
        <asp:Button ID="bContCompra" CssClass="submit_btn" runat="server" Text="Continuar Comprando" OnClick="bContCompra_Click" />
    </div>
    <div class="grid-4-12 ">
        <asp:Button ID="bAtualizarCarrinho" CssClass="submit_btn" runat="server" Text="Atualizar Carrinho" onclick="bAtualizarCarrinho_Click" />
    </div>
    <div class="grid-3-12 ">
        <asp:Button ID="bFinalizarCompra" CssClass="submit_btn" runat="server" Text="Finalizar" OnClick="bFinalizar_Click" />
    </div>

</div>
<div id="content_bottom"></div>

</asp:Content>
